package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.internetofthings.firefightingiot;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.internetofthings.firefightingiot.FireFightingIOTService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 消防物联网控制器
 */
@Action
@RequestMapping(value="fireFightingIOT/fireFightingIOT")
public class FireFightingIOTController extends BaseController {
    @Resource
    public FireFightingIOTService fireFightingIOTService;

    /**
     * 大数据
     * @param
     * @return
     */
    @At(value = "getBigData", method = RequestMethod.GET)
    public RespEntity getBigData(@RequestBody(required = false) JSONObject jsonParam) {
        return fireFightingIOTService.getBigData(jsonParam);
    }

    /**
     * web端大数据排行接口
     * @param
     * @return
     */
    @At(value = "webBigData", method = RequestMethod.GET)
    public RespEntity webBigData(@RequestBody(required = false) JSONObject jsonParam) {
        return fireFightingIOTService.webBigData(jsonParam);
    }

    /**
     * 报警单位top5
     * @param
     * @return
     */
    @At(value = "alarmBusinessAnalysisList", method = RequestMethod.GET)
    public RespEntity alarmBusinessAnalysisList(@RequestBody(required = false) JSONObject jsonParam) {
        return fireFightingIOTService.alarmBusinessAnalysisList(jsonParam);
    }

    /**
     * web端大数据下方分类统计
     * @param
     * @return
     */
    @At(value = "webBigDataForClassify", method = RequestMethod.GET)
    public RespEntity webBigDataForClassify(@RequestBody(required = false) JSONObject jsonParam) {
        return fireFightingIOTService.webBigDataForClassify(jsonParam);
    }

    /**
     * 首页数据
     * @param
     * @return
     */
    @At(value = "getHomePageData", method = RequestMethod.GET, param = { "nums","type","userType"})
    public RespEntity getHomePageData(@RequestBody(required = false) JSONObject jsonParam) {
        return fireFightingIOTService.getHomePageData(jsonParam);
    }
    /**
     * 首页数据(仓库)
     * @param
     * @return
     */
    @At(value = "getHomePageDataWareHouse", method = RequestMethod.GET, param = { "nums","type","userType"})
    public RespEntity getHomePageDataWareHouse(@RequestBody(required = false) JSONObject jsonParam) {
        return fireFightingIOTService.getHomePageDataWareHouse(jsonParam);
    }

    /**
     * 实时报警列表
     * @param
     * alarmType	报警类型
     * @return
     */
    @At(value = "realTimeAlarm", method = RequestMethod.GET)
    public RespEntity realTimeAlarm(@RequestBody(required = false) JSONObject jsonParam) {
        return fireFightingIOTService.realTimeAlarm(jsonParam);
    }

    /**
     * 获取单位详情
     * @param  单位id：如果是机构用户登录需要传,如果是单位用户自己取
     * @return
     */
    @At(value = "getBusinessDetail", method = RequestMethod.GET)
    public RespEntity getBusinessDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return fireFightingIOTService.getBusinessDetail(jsonParam);
    }
   
}
